import { defineStore } from "pinia"

export const userStore = defineStore("user", {
  persist: {
    paths: ["cityId", "cityName", "uesrdata"],
  },

  state() {
    return {
      uesrdata: null,
      cityId: 440300,
      cityName: "深圳",
    }
  },
  getters: {
    getAdminname(state) {
      return state.uesrdata?.adminname;
    },
  },
  actions: {
    setUesrdata(payload) {
      this.uesrdata = payload;
    },
  },
  persist: true,
})

